
<script setup lang="ts">
import { getCurrentInstance, ref, reactive, watch, onBeforeMount, onMounted, onUpdated, nextTick } from 'vue'
import { onBeforeRouteLeave } from 'vue-router'
import { Swiper, SwiperSlide } from 'swiper/vue'
import 'swiper/css'
import MeScroll from 'mescroll.js'
import 'mescroll.js/mescroll.min.css'
const { proxy } = getCurrentInstance()

/* ---- */
const WXConfig = proxy.$Store.get('WXConfig') || {}
const forSys = proxy.$Sys || []

/* ---- */
const user = reactive({
  desc: '',
  info: '',
  btnTxt: '开通移动门店，云仓进货',
  telphone: '',
  advs: [],
  // ----
  title: '',
  // ----
  share_title: proxy.$shareTitle,
  share_desc: proxy.$shareDesc,
  share_icon: proxy.$shareIcon
})
// ----
const totalCount = ref(0)
const tbtns = [{
  show: true,
  name: '企业风采',
  icon: 'fa fa-images',
  callback: (item, event) => {
    if (Number(user.advs.length) > 0) {
      const curEL = event.currentTarget
      const options = {
        actElement: curEL,
        addopt: {
          loop: true,
          dataSource: user.advs
        }
      }
      proxy.$Myfun.isIndepth(preImg.value, 'openPhotoSwipe', options)
    }
  }
}, {
  show: true,
  name: '下载列表',
  icon: 'fa fa-cloud-download-alt',
  callback: () => { proxy.$Myfun.openPage(proxy, 'push', 'SelfMaterial', { dealer_id: proxy.$route.query.dealer_id }) }
}]
// ----
const moveTime = 50
let showMarquee = null
// ----
const infoSch = ref(null)
const forSearch = ref(proxy.$Store.get('forSearch') || {})
// ----
let myIndex = 0
const curCate = ref('分类选择')
const cateRoot = ref(null)
let cateSon = null
let cateRoots = []
let cates = []
let units = []
// ----
const tSpeed = 300
let bar = null
let clientWidth = 0
let navWidth = 0
let navSwiper = null
const navText = '全部'
const areas = ref([])
// --mescroll--
const noData = proxy.$Global.noData
let mescroll = null
const items = ref([])

/* ---- */
const sliding = ref()
const preImg = ref()
const layer = ref()
const layerBox = ref()

/* ---- */
const setAppTitle = (title) => {
  document.title = title
  // --利用iframe的onload事件刷新页面--
  const iframe = document.createElement('iframe')
  iframe.style.visibility = 'hidden'
  iframe.style.width = 0
  iframe.style.height = 0
  document.body.appendChild(iframe)
  nextTick(() => { document.body.removeChild(iframe) })
}
// --设置微信分享--
const setWebShare = (info) => {
  const forSn = proxy.$Store.get('SN')
  const currentUrl = window.location.href.split('#')[0]
  const shareLink = (Number(currentUrl.indexOf('sn=')) === Number(-1)) ? ((Number(currentUrl.indexOf('?')) === Number(-1)) ? currentUrl + '?sn=' + forSn : currentUrl + '&sn=' + forSn) : currentUrl
  proxy.$WxTool.loadJsdk(WXConfig, (obj) => {
    if (!obj) return
    // ----
    obj.hideMenuItem()
    obj.showMenuList(['menuItem:share:appMessage', 'menuItem:share:timeline', 'menuItem:share:qq', 'menuItem:share:weiboApp', 'menuItem:favorite', 'menuItem:share:QZone'])
    // ----
    obj.share({
      title: info.title,
      desc: info.desc,
      link: shareLink,
      imgUrl: info.imgUrl
    })
  })
}
// ----
const initData = () => {
  const curItems = cates.filter((item) => { return Number(item.parent_id) === Number(cateRoot.value) })
  const areaItems = []
  curItems.forEach((item, index) => {
    areaItems.push({
      value: String(item.id),
      text: proxy.$Myfun.setText(item.name)
    })
    // ----
    if (String(item.id) === String(cateSon)) myIndex = index + 1
  })
  areas.value = areaItems
}
// --initSwiperData || changeSwiperData--
const onSwiper = (swiper) => { navSwiper = swiper }
const initSwiper = (index) => {
  if (Number(areas.value.length) === 0) return false
  // --初始化--
  if (!navSwiper.el.querySelector('.bar')) {
    const newBar = document.createElement('div')
    newBar.setAttribute('class', 'bar')
    newBar.innerHTML = '<span class="xw-anim"></span>'
    navSwiper.wrapperEl.appendChild(newBar)
  }
  bar = navSwiper.el.querySelector('.bar')
  navSwiper.slides[navSwiper.activeIndex].querySelector('span').style.color = '#3388ff'
  // --Nav的可视宽度--
  clientWidth = navSwiper.wrapperEl.offsetWidth
  navWidth = 0
  for (let i = 0; i < navSwiper.slides.length; i++) {
    navWidth += navSwiper.slides[i].offsetWidth
  }
  // --点击slide事件--
  navSwiper.on('tap', () => {
    const newItems = []
    if (navSwiper.slides[navSwiper.clickedIndex].querySelector('span').innerText !== String(navText)) newItems.push(navSwiper.slides[navSwiper.clickedIndex].getAttribute('data-ID'))
    proxy.$Myfun.setSearchRes(proxy, newItems, ['cateSon'], (result) => { forSearch.value = result })
  })
  // ----
  setTimeout(() => { swiperMescroll(index) }, 100)
}
const swiperMescroll = (index) => {
  const clickIndex = index
  const clickSlide = navSwiper.slides[clickIndex]
  const activeSlidePosition = navSwiper.slides[clickIndex].offsetLeft

  // --释放时导航移动过渡--
  bar.style.transitionDuration = tSpeed + 'ms'
  bar.style.width = clickSlide.offsetWidth + 'px'
  bar.querySelector('span').style.width = clickSlide.querySelector('span').offsetWidth + 'px'
  bar.style.transform = 'translateX(' + activeSlidePosition + 'px)'

  // --导航居中--
  const navSlideWidth = clickSlide.offsetWidth
  // --activeSlide距左边的距离--
  const navActiveSlideLeft = navSwiper.slides[clickIndex].offsetLeft

  navSwiper.setTransition(tSpeed)
  if (navWidth > clientWidth) {
    if (navActiveSlideLeft < (clientWidth - navSlideWidth) / 2) {
      navSwiper.setTranslate(0)
    } else if (navActiveSlideLeft > navWidth - (navSlideWidth + clientWidth) / 2) {
      navSwiper.setTranslate(clientWidth - navWidth)
    } else {
      navSwiper.setTranslate((clientWidth - navSlideWidth) / 2 - navActiveSlideLeft)
    }
  }

  navSwiper.slides.forEach((current) => { current.querySelector('span').style.color = '#111111' })
  clickSlide.style.transitionDuration = tSpeed + 'ms'
  clickSlide.querySelector('span').style.color = '#3388ff'
}
// ----
const setMarquee = () => {
  if (proxy.$refs.forMarquee) {
    const el = proxy.$refs.forMarquee.querySelector('ul')
    const forLi = el.innerHTML
    if (Number(el.firstChild.offsetWidth) > Number(el.offsetWidth)) {
      el.innerHTML = forLi + forLi
      showMarquee = setInterval(marqueefun, moveTime)
    }
  }
}
const marqueefun = () => {
  if (proxy.$refs.forMarquee) {
    const el = proxy.$refs.forMarquee.querySelector('ul')
    if (Number(el.lastChild.offsetWidth) <= Number(el.scrollLeft)) {
      el.scrollLeft = el.scrollLeft - el.firstChild.offsetWidth
    } else {
      el.scrollLeft = el.scrollLeft + 1
    }
  }
}
const stopRolling = () => {
  if (showMarquee) {
    clearInterval(showMarquee)
    showMarquee = null
  } else {
    showMarquee = setInterval(marqueefun, moveTime)
  }
}
// ----
const getCateName = () => {
  let forCurCate = ''
  const forCateName = cateRoots.some((item) => {
    if (String(item.value) === String(cateRoot.value)) {
      forCurCate = item.text
      return true
    }
  })
  if (!forCateName) forCurCate = '分类选择'
  // ----
  curCate.value = forCurCate.substr(0, 6)
}
// ----
const getCurrencyInfo = async (callback) => {
  // -- 获取用户信息 & 商品分类 & 自定义计量单位 --
  const forUserData = { params: { 'DealerSearch[id]': proxy.$route.query.dealer_id } }
  const forCateData = {
    params: {
      'ProCategorySearch[dealer_id]': proxy.$route.query.dealer_id,
      // --是否云仓分类--
      'ProCategorySearch[is_store]': 1,
      // ----
      sort: 'SORT_ASC',
      // ----
      page: 1,
      PageSize: 1000000
    }
  }
  const forUnitData = {
    params: {
      'MeasuringUnitSearch[dealer_id]': proxy.$route.query.dealer_id,
      // --是否云仓计量单位--
      'MeasuringUnitSearch[is_store]': 1,
      // ----
      sort: 'SORT_ASC',
      // ----
      page: 1,
      PageSize: 1000000
    }
  }
  await proxy.$Axios.all([
    proxy.$Axios.get('dealer/index', forUserData),
    proxy.$Axios.get('pro-category/index', forCateData),
    proxy.$Axios.get('measuring-unit/index', forUnitData)
  ]).then(proxy.$Axios.spread((userData, cateData, unitData) => {
    // --用户信息--
    const UData = userData.items[0] || {}
    user.telphone = UData.tag || UData.telphone
    proxy.$Myfun.getJsonData(UData.ads_content, (resJson) => {
      if (resJson[0].material && resJson[0].material.desc) user.desc = resJson[0].material.desc
    })
    if (UData.name) user.share_title = proxy.$Myfun.setText(UData.name)
    if (UData.remark) user.share_desc = proxy.$Myfun.setText(UData.remark)
    proxy.$Myfun.getJsonData(UData.avatar, (resJson) => {
      if (Number(resJson.length) > 0) user.share_icon = resJson[0].image
    })
    const advItems = []
    proxy.$Myfun.getJsonData(UData.intention, (resJson) => {
      resJson.forEach((item) => {
        advItems.push({
          msrc: item.image,
          src: item.image,
          width: item.width,
          height: item.height,
          alt: ''
        })
      })
    })
    user.advs = advItems
    // --商品分类--
    cates = cateData.items
    const cateItems = cates.filter((item) => { return Number(item.parent_id) === 0 })
    const rootItems = []
    cateItems.forEach((item, index) => {
      rootItems.push({
        value: String(item.id),
        text: proxy.$Myfun.setText(item.name)
      })
    })
    cateRoots = rootItems
    // --计量单位--
    const unitItems = []
    unitData.items.forEach((item, index) => {
      unitItems.push({
        value: String(item.id),
        text: proxy.$Myfun.setText(item.name)
      })
    })
    units = unitItems
  })).catch((err) => { proxy.$Myfun.forToast(layer.value, 'open', err) })
  // --获取定制功能--
  const customItems = forSys.filter((item) => { return String(item.name) === 'market_customFuncUser' })
  if (Number(customItems.length) === 1) {
    await proxy.$Myfun.getJsonData(customItems[0].value, (resJson) => {
      if (Number(resJson.length) > 0) {
        if (resJson[0].material && Number(resJson[0].material.length) > 0) {
          resJson[0].material.some((item) => {
            if (String(item.telphone) === String(user.telphone)) user.info = item.name
          })
        }
      }
    })
  }
  // ----
  if (user.desc) nextTick(() => { setMarquee() })
  // ----
  if (user.info) user.title =  user.info + document.title
  // --设置网页title--
  const forTitle = user.title || document.title
  setAppTitle(forTitle)
  // --设置微信分享功能--
  const forShare = {
    title: user.share_title,
    desc: user.share_desc,
    imgUrl: user.share_icon
  }
  setWebShare(forShare)
  // ----
  callback && callback()
}
// --getData--
const startMeScroll = () => {
  mescroll = new MeScroll(proxy.$refs.dataScroll, {
    up: {
      callback: getListData,
      isBounce: false,
      page: { num: 0, size: 10 },
      htmlNodata: '<p class="upwarp-nodata">-- 到底啦 --</p>',
      noMoreSize: 10,
      toTop: {
        src: '/pics/mescroll-totop.png',
        offset: 1000
      },
      empty: {
        warpId: proxy.$refs.dataList,
        tip: noData
      }
    }
  })
}
const getListData = (page) => {
  getListDataFromNet({
    forUrl: 'material-book/index',
    forData: {
      params: {
        'MaterialBookSearch[product_name]': infoSch.value,
        'MaterialBookSearch[has_parent_id]': cateRoot.value,
        'MaterialBookSearch[pro_category_id]': cateSon,
        // ----
        'MaterialBookSearch[mb_dealer_id]': proxy.$route.query.dealer_id,
        // ----
        sort: 'SORT_DESC',
        // ----
        page: page.num,
        PageSize: page.size
      }
    }
  }, page.num, page.size, (curPageData) => {
    setListData(curPageData).then((result) => {
      mescroll.endSuccess(curPageData ? curPageData.length : 0, true)
      items.value = items.value.concat(result)
    })
  }, (resMsg) => {
    mescroll.endErr()
    proxy.$Myfun.forToast(layer.value, 'open', resMsg)
  })
}
const getListDataFromNet = (option, pageNum, pageSize, successCallback, errorCallback) => {
  if (Number(pageNum) === 1) {
    if (document.querySelector('.upwarp-nodata')) { document.querySelector('.upwarp-nodata').style.visibility = 'hidden' }
    items.value = []
  }
  // ----
  proxy.$http.get(option.forUrl, option.forData).then((res) => {
    totalCount.value = res._meta.totalCount
    // ----
    successCallback && successCallback(res.items)
  }).catch((err) => { errorCallback && errorCallback(err) })
}
const getNeedDate = async (curItem) => {
  let forAdv = ''
  let psize = [{
    name: '',
    cloudprice: '',
    price: '',
    unit: 0
  }]
  let forUnit = ''
  // ----
  await proxy.$http.get('proc/index', {
    params: { 'ProductSearch[id]': curItem.product_id }
  }).then((res) => {
    if (Number(res.items.length) > 0) {
      const GData = res.items[0]
      // ----
      proxy.$Myfun.getJsonData(GData.img_top, (resJson) => { forAdv = resJson[0].image })
      proxy.$Myfun.getJsonData(GData.price_json, (resJson) => { psize = resJson })
      units.some((item) => {
        if (String(item.value) === String(psize[0].unit)) forUnit = item.text
      })
      // ----
      curItem.name = proxy.$Myfun.setText(GData.name)
      curItem.image = forAdv
      curItem.cloudprice = Number(psize[0].cloudprice).toFixed(2)
      curItem.price = Number(psize[0].price).toFixed(2)
      curItem.unitTxt = forUnit
      curItem.noteTxt = proxy.$Myfun.setText(GData.proremark_id)
      // ----
      curItem.isFromCloud = Number(GData.is_type) === 1
    } else {
      curItem.isProduct = false
    }
  }).catch((err) => { proxy.$Myfun.forToast(layer.value, 'open', err) })
}
const setListData = async (items) => {
  const newItems = []
  for (let i = 0; i < Number(items.length); i++) {
    const item = items[i]
    // ----
    const curItem = {
      id: item.id,
      product_id: item.product_id,
      // ----
      isProduct: true,
      // ----
      name: '',
      image: '',
      cloudprice: 0,
      price: 0,
      unitTxt: '',
      noteTxt: '',
      // ----
      isFromCloud: false
    }
    // ----
    await getNeedDate(curItem)
    // ----
    newItems.push(curItem)
  }
  return newItems
}
const divScroll = (event) => { proxy.$Myfun.setImgToTop() }
// ----
const emptyInfo = (event) => {
  const curEL = event.currentTarget
  const input = curEL.parentElement.querySelector('input')
  input.value = ''
  input.dispatchEvent(new Event('input'))
  // ----
  getHeadFun(2)
}
// ----
const getHeadFun = (type, item) => {
  switch (Number(type)) {
    case 1: {
      const options = {
        type: 0,
        forall: { show: true, text: '不限分类' },
        slideName: 'slideLeft',
        boxClass: 'SLB-box-left',
        itemId: cateRoot.value || 0,
        title: '选择分类',
        list: cateRoots,
        callback: (info) => { proxy.$Myfun.setSearchRes(proxy, [info[1]], ['cateRoot'], (result) => { forSearch.value = result }) }
      }
      proxy.$Myfun.isIndepth(sliding.value, 'open', options)
      break
    }
    case 2: {
      const newItems = []
      newItems.push(infoSch.value)
      proxy.$Myfun.setSearchRes(proxy, newItems, ['infoSch'], (result) => { forSearch.value = result })
      break
    }
    case 3: {
      proxy.$Myfun.getTopH().then((result) => {
        const forSlideTop = result
        // ----
        const options = {
          type: 3,
          forall: { show: true, text: '不限分类', value: '' },
          boxTop: { top: forSlideTop + 'px' },
          slideName: 'slideDown',
          boxClass: 'SLB-box-down',
          floatClass: 'xw-float-W2',
          itemId: cateSon || 0,
          title: '分类',
          list: areas.value,
          callback: (info) => { proxy.$Myfun.setSearchRes(proxy, info, ['cateSon'], (result) => { forSearch.value = result }) }
        }
        proxy.$Myfun.isIndepth(sliding.value, 'open', options)
      })
      break
    }
  }
}
const getAuditFun = (type, item, event) => {
  switch (Number(type)) {
    case 1: {
      proxy.$Myfun.openPage(proxy, 'push', 'MaterialView', { id: item.id, dealer_id: proxy.$route.query.dealer_id, goods_id: item.product_id })
      break
    }
    case 2: {
      proxy.$Myfun.openPage(proxy, 'push', 'UcenTer')
      break
    }
    case 3: {
      item.callback && item.callback(item, event)
      break
    }
  }
}

/* ---- */
watch(() => forSearch.value, (newVal, oldVal) => {
  infoSch.value = newVal.infoSch
  // ----
  cateRoot.value = newVal.cateRoot
  cateSon = newVal.cateSon
  // ----
  getCateName()
  // ----
  myIndex = 0
  // ----
  if (String(newVal.cateRoot) !== String(oldVal.cateRoot)) {
    cateSon = null
    // ----
    proxy.$Myfun.setSearchRes(proxy, [cateRoot.value, cateSon], ['cateRoot', 'cateSon'], (result) => { forSearch.value = result })
    // ----
    if (cateRoot.value) {
      initData()
      nextTick(() => { initSwiper(myIndex) })
    }
  } else {
    if (cateRoot.value && Number(areas.value.length) > 0) {
      areas.value.some((item, index) => {
        if (String(item.value) === String(cateSon)) myIndex = index + 1
      })
      nextTick(() => { swiperMescroll(myIndex) })
    }
    // --重新请求数据--
    mescroll.scrollTo(0)
    mescroll.resetUpScroll()
  }
}, { deep: true })

/* ---- */
onBeforeMount(() => {
  infoSch.value = forSearch.value.infoSch
  // ----
  cateRoot.value = forSearch.value.cateRoot
  cateSon = forSearch.value.cateSon
})
onMounted(() => {
  getCurrencyInfo(() => {
    if (cateRoot.value) {
      initData()
      nextTick(() => { initSwiper(myIndex) })
    }
    // ----
    getCateName()
    // --创建MeScroll对象--
    setTimeout(() => { startMeScroll() }, 500)
  })
})
onUpdated(() => { nextTick(() => { proxy.$Myfun.setSectionH() }) })
onBeforeRouteLeave(() => {
  if (mescroll) mescroll.destroy()
  proxy.$Store.remove('forSearch')
})
</script>

<template>
  <div>
    <header class="xw-bg-gray">
      <div class="forTop xw-bgCL-11 xw-flex xw-flex-align" v-if="user.desc">
        <div class="TOP-msg xw-Lfg xw-flex-W1">
          <div class="forMarquee">
            <div ref="forMarquee" class="FMQ-con xw-act xw-flex xw-flex-align" @click="stopRolling">
              <ul class="xw-flex-W1">
                <li>{{user.desc}}</li>
              </ul>
            </div>
          </div>
        </div>
      </div>
      <div class="forTop xw-flex xw-flex-align">
        <a class="TOP-grap TOP-L xw-flex xw-flex-center" @click="getHeadFun(1)"><p>{{curCate}}</p></a>
        <div class="TOP-sch xw-bg-white xw-radius-3 xw-flex-W1 xw-flex xw-flex-align">
          <em class="far fa-search TOP-L"></em>
          <p class="xw-flex-W1"><input class="schText" type="text" :placeholder="user.info + '（商品：' + totalCount + '个）'" v-model.trim="infoSch"/></p>
          <transition name="fade"><em class="fa fa-times-circle" @click="emptyInfo" v-if="infoSch"></em></transition>
          <span class="TOP-btn TOP-R xw-Lfg" @click="getHeadFun(2)">搜索</span>
        </div>
      </div>
      <div class="forMenu xw-flex xw-flex-align" v-if="cateRoot && Number(areas.length) > 0">
        <div class="FMU-menu xw-flex-W1">
          <div class="FMU-box FMU-L FMU-R">
            <swiper :slides-per-view="'auto'" :freeMode="true" @swiper="onSwiper">
              <swiper-slide><span class="xw-middle">{{navText}}</span></swiper-slide>
              <swiper-slide v-for="(item, index) in areas" :data-ID="item.value"><span class="xw-middle">{{item.text}}</span></swiper-slide>
            </swiper>
          </div>
        </div>
        <a class="fa fa-list-ul FMU-icon xw-color-12 FMU-R xw-flex xw-flex-center" @click="getHeadFun(3)"></a>
      </div>
    </header>
    <div class="xw-section">
      <div ref="dataScroll" class="mescroll" @scroll="divScroll">
        <ul class="list-goods xw-flex xw-flex-column" ref="dataList">
          <li class="xw-Tfg xw-bg-white" v-for="(item, index) in items">
            <a @click="getAuditFun(1, item)" v-if="item.isProduct">
              <div class="LGD-top xw-flex xw-flex-align">
                <img class="LGD-img" :src="item.image"/>
                <div class="LGD-con xw-flex-W1">
                  <div class="LGD-title" :class="[item.isFromCloud ? 'xw-ellipsis-2' : 'xw-ellipsis-3']">{{item.name}}</div>
                  <template v-if="item.isFromCloud">
                    <div class="LGD-price xw-flex xw-flex-align">
                      <span class="xw-color-13">销售参考价：</span>
                      <span class="xw-color-11">{{item.price}}</span>
                      <span>元</span>
                      <span v-if="item.unitTxt">/{{item.unitTxt}}</span>
                    </div>
                    <div class="LGD-price xw-flex xw-flex-align">
                      <span class="xw-color-13">分销进货价：</span>
                      <span class="xw-color-11">{{item.cloudprice}}</span>
                      <span>元</span>
                      <span v-if="item.unitTxt">/{{item.unitTxt}}</span>
                    </div>
                  </template>
                  <template v-else >
                    <div class="LGD-price xw-flex xw-flex-align">
                      <span class="xw-color-13">销售价格：</span>
                      <span class="xw-color-11">{{item.price}}</span>
                      <span>元</span>
                      <span v-if="item.unitTxt">/{{item.unitTxt}}</span>
                    </div>
                  </template>
                  <div class="LGD-note xw-ellipsis" v-if="item.noteTxt">{{item.noteTxt}}</div>
                </div>
              </div>
            </a>
            <div class="LGD-empty" v-else>产品已删</div>
          </li>
        </ul>
      </div>
    </div>
    <footer>
      <div class="tabs xw-foot-Tfg xw-flex xw-flex-align">
        <div class="TAB-mbtn xw-radius-3 xw-bgCL-11 xw-act xw-ellipsis xw-flex-W1" @click="getAuditFun(2)">{{user.btnTxt}}</div>
        <div class="TAB-btn xw-flex">
          <template v-for="(item, index) in tbtns">
            <a class="xw-flex xw-flex-center" @click="getAuditFun(3, item, $event)" v-if="item.show">
              <span><em :class="item.icon"></em>{{item.name}}</span>
            </a>
          </template>
        </div>
      </div>
    </footer>
    <sliding-view ref="sliding"/>
    <preImg-view ref="preImg"/>
    <layer-view ref="layer"/>
    <layer-view ref="layerBox"/>
  </div>
</template>

<style scoped>
/* ---- */
.TOP-msg { padding: 0 0 0 0.4rem; }
.TOP-msg:before { top: 0.2rem; bottom: 0.2rem; width: 0.8rem; background: #ffffff; }

/* ---- */
.forMenu { margin-top: -0.8rem; height: 4rem; }

/* ---- */
.forMarquee { height: 100%; padding: 0 0 0 1rem; }
.FMQ-con { height: 100%; }
.FMQ-con ul { white-space: nowrap; overflow: hidden; }
.FMQ-con li { display: inline-block; font-size: 1.7rem; font-weight: bold; }

/* ---- */
.list-goods li a { display: block; padding: 1.2rem 1rem; }
.list-goods li:before { left: 1rem; right: 1rem; }
.list-goods li:nth-of-type(1):before { display: none; }
.LGD-img { margin: 0 1rem 0 0; width: 13rem; height: 13rem; }
.LGD-title { line-height: 2.5rem; font-size: 1.7rem; }
.LGD-price { line-height: 2.5rem; }
.LGD-note { margin: 0.5rem 0 0; padding: 0 0.5rem; line-height: 2.5rem; font-size: 1.2rem; color: #888888; background: #f5f5f5; }
.LGD-empty { padding: 1.2rem 1rem; line-height: 2.5rem; font-size: 1.7rem; }

/* ---- */
.tabs { padding: 0 1rem; }
.TAB-mbtn { height: 4rem; line-height: 4rem; font-size: 1.6rem; }
.TAB-btn { margin: 0 0 0 1rem; height: 100%; }
.TAB-btn a { padding: 0 1rem; }
</style>